home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Setting Context
- Sent: 3/11/96 1:45 PM
- Received: 3/11/96 1:01 PM
- From: Damon Cokenias, cokenias@mtn-palace.com
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- (I sent this Sunday night, but didn't see it on the list. If it doesn't
- show up this time, I'm going to panic.)
-
- ------
-
- >Henri & team,
- >I have a part which is based on ODF Draw (d11). Within my content view,
- >I've embedded some subframes.
- >
- >I'm trying to understand the correct way to set the context so I can render
- >within these subframes. I've tried using FW_CViewContext,
- >FW_CFacetContext, and FW_CPlatformGraphicContext (individually, of course).
- >I want to set the context and then render within the frame using a mix of
- >ODF rendering methods and native calls. I would expect that after setting
- >the context, my rendering would be clipped to the subframe and all of my
- >rendering would also be relative to the subframe (nominally the topLeft
- >corner).
-
- You should probably render within these subframes from within the
- subframe's Draw method. I have a part which embeds itself as a subframe
- (using a different presentation, of course). I use the
-
- void CMySubFrame::Draw (Environment* ev, ODFacet* odFacet, ODShape*
- invalidShape)
- {
- FW_CViewContext vc (ev, this, odFacet, invalidShape);
- FW_CRectShape::RenderRect (vc, GetBounds(ev), FW_kFill, FW_CColor
- (0xF0, 0xF0, 0xF0));
- }
-
- This works because, of course, an FW_CFrame is also a FW_CView. I don't
- recommend drawing into your subframes from your main frame's Draw method (I
- infer this is what you are doing). This is going behind OpenDoc's back and
- is trickier than it needs to be.
-
- In my opinion, one of the big reasons to have subframes in the first place
- is to take advantage of the seperate Draw messages.
-
- If I misunderstood your posting, or if you have a compelling reason to do
- all of your drawing within one method, let us know.
-
- -Damon Cokenias
- ODF Team
-
-
- +-----------------------------------------------------------------------+
- | /\ Damon Cokenias |
- | /^^\ cokenias@mtn-palace.com |
- | /____\ Visit the Mountain Palace at http://www.netgate.net/~cokenias |
- +-----------------------------------------------------------------------+
-
-